import { S } from '../../s';
import { IPSRawItemBase } from '../ipsraw-item-base';
import { IPSRawItemParam } from '../ipsraw-item-param';
import { IPSSysCss } from '../../res/ipssys-css';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSRawItemImplBase
  extends PSModelObjectImpl
  implements IPSRawItemBase
{
  get contentType(): string {
    return this.M.contentType;
  }

  get cssStyle(): string {
    return this.M.cssStyle;
  }

  get dynaClass(): string {
    return this.M.dynaClass;
  }

  protected psrawitemparams: IPSRawItemParam[];
  getPSRawItemParams(): IPSRawItemParam[] | null {
    return (
      this.psrawitemparams ||
      (this.psrawitemparams = this.fillChildListModel(
        this.M.getPSRawItemParams,
        S._3c0,
      ) as IPSRawItemParam[])
    );
  }

  findPSRawItemParam(objKey: any): IPSRawItemParam | null {
    return this.getPSModel5(
      S._3c0,
      this.getPSRawItemParams(),
      objKey,
    ) as IPSRawItemParam;
  }

  protected pssyscss: IPSSysCss;
  getPSSysCss(): IPSSysCss | null {
    return (
      this.pssyscss ||
      (this.pssyscss = this.fillObjectModel(
        S._278,
        this.M.getPSSysCss,
        S._2ac,
      ) as IPSSysCss)
    );
  }

  get predefinedType(): string {
    return this.M.predefinedType;
  }

  get rawItemHeight(): number {
    return this.M.rawItemHeight != null ? this.M.rawItemHeight : 0.0;
  }

  get rawItemWidth(): number {
    return this.M.rawItemWidth != null ? this.M.rawItemWidth : 0.0;
  }

  get templateMode(): boolean {
    return this.M.templateMode != null ? this.M.templateMode : false;
  }
  get cls(): string {
    return 'PSRawItemImplBase';
  }
  instanceof(cls: string): boolean {
    if (cls == S._3ae) return true;
    return super.instanceof(cls);
  }
}
